﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" >
<head>
  <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
  <link rel="stylesheet" href="../css/uftestsuite.css" type="text/css" />
  <title>Microformats testsuites</title>
</head>
<body class="documentation">

    <p>
    <a href="http://www.ufxtract.com/testsuite/"><img border="0" id="testsuite-image" alt="Microformats testsuite" src="../images/testsuite.gif" /></a><br />
    </p>
    
    <h1>Overview of test-fixture </h1>
    
    <h2>Introduction</h2>
    <p>
    The test-fixture is a description of a group of software tests embedded into simple HTML. 
    It is designed as a microformat, but as it has not yet been through the community review 
	process, 
    it is called a POSH pattern. The idea is to build a series of pages containing 
    test-fixtures into a full test-suite. This specification should be 
	considered a draft. Contents are subject to change. It is provided here for 
	reference and as a basis for discussion and ongoing development.
	</p>
    
 
 	<h2>Author</h2> 
 	<p class="vcard"><a class="fn url" href="http://www.glennjones.net/">Glenn Jones</a></p>   
 
    <h2>Structure</h2>
    <ul>
	    <li>class=&quot;<strong>test-fixture</strong>&quot;&nbsp;<ul>
		    <li>class=&quot;summary&quot;</li>
		    <li>class=&quot;<em>description</em>&quot;</li>
		    <li>class=&quot;<strong>format</strong>&quot;</li>
		    <li>class=&quot;<em>author</em>&quot; (hcard)</li>
		    <li>class=&quot;<em>output</em>&quot;<ul>
			    <li>class=&quot;type&quot; [JSON,XML]</li>
			    <li>class=&quot;value&quot;</li>
		    </ul>
		    </li>
		    <li>class=&quot;<em>assert</em>&quot;<ul>
			    <li>class=&quot;test&quot;</li>
			    <li>class=&quot;result&quot;</li>
			    <li>class=&quot;comment&quot;</li>
		    </ul>
		    </li>
		    <li>class=&quot;<em>history</em>&quot; (vevent)</li>
	    </ul>
	    </li>
    </ul>
    <p>Key</p>
    <p><strong>Single occurrence required <br />
    </strong>Single occurrence optional<br />
    <em>Zero or More occurrence</em>s</p>

    <h2>Properties</h2>
    
    <dl>
    <dt>summary</dt>
    <dd>The title of the test-fixture</dd>
    
    <dt>description</dt>
    <dd>An expanded piece of text about the test-fixture</dd>
    
    <dt>format</dt>
    <dd>The format to be tested</dd>
    
    <dt>author</dt>
    <dd>The authors of the test-fixture, these are hCards</dd>
    
    <dt>output</dt>
    <dd>This is an example output which would be expected form the test. <br /> 
    The child 'type' property can be used to describe the output format.<br /> 
    The child 'value' property a URL to link to the example.
    </dd>
    
    <dt>assert</dt>
    <dd>The assert is a description of a test.<br /> 
    The child 'test' property describes the element to test.<br />  
    The child 'result' property describes expected result for the test.<br /> 
    The child 'comment' is an expanded piece of text about the test.
    </dd>
    
    <dt>history</dt>
    <dd>The history of changes to test-fixture, these are hcalendar events</dd>
    
    </dl>
    
    <h2>Embeding microformats to test within the same page</h2>
    <p>
    Where you are testing microformats you can embed them into the same page as the 
    test-fixture. As the test-fixture itself contains microformats such as hCards 
    we need to define what section of the page to parse. 
    </p>
    <p>
    Some parsers such as UfXtarct and Sumo already have this ability, for other I have 
    provided a simple <a href="http://www.ufxtract.com/proxies/proxy.aspx">proxy service</a>. It allows you to define a URL of a page 
    and the ID of any element and it returns a HTML page containing just that element.
    </p>
    <p> 
    For the sake of consistency within the microformats test-suite the ID should be ID “uf”.
    </p>
    
    
    <h2>Currently supported test methods</h2>
	<ul>
		<li>IsEqualTo()</li>
		<li>isEqualToCaseInsensitive()</li>
		<li>IsEqualToISODate()</li>
		<li>IsEqualToPhoneNumbers()</li>
		<li>isEqualToGeo()</li>
		<li>IsTrue()</li>
		<li>IsFalse()</li>
		<li>HasProperty()</li>
	</ul>

    
    
    <h2>Exmaple</h2>
    

<pre>

&lt;h1 class=&quot;summary&quot;&gt;hCard 1 - single occurrence test&lt;/h1&gt;
&lt;p class=&quot;description&quot;&gt;
This page was designed to test the values of a hcard 
which are meant to have only a single occurrence parsed correctly.
&lt;/p&gt;

&lt;p&gt;From: &lt;a href=&quot;default.htm&quot;&gt;&lt;span class=&quot;format&quot;&gt;hCard&lt;/span&gt; testsuite 1.0&lt;/a&gt;&lt;/p&gt;
    
&lt;p class=&quot;author vcard&quot;&gt; 
Author: 
&lt;a class=&quot;url fn&quot; href=&quot;http://www.glennjones.net/&quot;&gt;Glenn Jones&lt;/a&gt; 
&lt;a class=&quot;org url&quot; href=&quot;http://www.madgex.com/&quot;&gt;Madgex&lt;/a&gt;
&lt;/p&gt;
    
&lt;p&gt;Output examples: 
&lt;ul&gt;
&lt;li class=&quot;output&quot;&gt;&lt;a class=&quot;url&quot; href=&quot;hcard1.js&quot;&gt;&lt;span class=&quot;type&quot;&gt;JSON&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;output&quot;&gt;&lt;a class=&quot;url&quot; href=&quot;hcard1.xml&quot;&gt;&lt;span class=&quot;type&quot;&gt;XML&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
    
    
&lt;p&gt;Tests:&lt;/p&gt;
&lt;table id=&quot;assetTable&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
&lt;thead&gt;
     &lt;tr&gt;
     &lt;th&gt;Test&lt;/th&gt;
     &lt;th&gt;Result&lt;/th&gt;
     &lt;th&gt;Comment&lt;/th&gt;
     &lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
        &lt;tr class=&quot;assert&quot;&gt;
        &lt;td class=&quot;test&quot;&gt;vcard[0].fn&lt;/td&gt;
        &lt;td class=&quot;result&quot;&gt;IsEqualTo(&quot;John Doe&quot;)&lt;/td&gt;
        &lt;td class=&quot;comment&quot;&gt;The fn (formatted name) is a singular value&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr class=&quot;assert&quot;&gt;
        &lt;td class=&quot;test&quot;&gt;vcard[0].n.given-name[0]&lt;/td&gt;
        &lt;td class=&quot;result&quot;&gt;IsEqualTo(&quot;John&quot;)&lt;/td&gt;
        &lt;td class=&quot;comment&quot;&gt;The n (name) is a singular value&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr class=&quot;assert&quot;&gt;
        &lt;td class=&quot;test&quot;&gt;vcard[0].bday&lt;/td&gt;
        &lt;td class=&quot;result&quot;&gt;IsEqualTo(&quot;2000-01-01T00:00:00-0800&quot;)&lt;/td&gt;
        &lt;td class=&quot;comment&quot;&gt;The bday (birthday) is a singular value&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr class=&quot;assert&quot;&gt;
        &lt;td class=&quot;test&quot;&gt;vcard[0].class&lt;/td&gt;
        &lt;td class=&quot;result&quot;&gt;IsEqualTo(&quot;Public&quot;)&lt;/td&gt;
        &lt;td class=&quot;comment&quot;&gt;The class is a singular value&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr class=&quot;assert&quot;&gt;
        &lt;td class=&quot;test&quot;&gt;vcard[0].geo.latitude&lt;/td&gt;
        &lt;td class=&quot;result&quot;&gt;IsEqualTo(&quot;30.267991&quot;)&lt;/td&gt;
        &lt;td class=&quot;comment&quot;&gt;The geo is a singular value&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr class=&quot;assert&quot;&gt;
        &lt;td class=&quot;test&quot;&gt;vcard[0].rev&lt;/td&gt;
        &lt;td class=&quot;result&quot;&gt;IsEqualTo(&quot;2008-01-01T13:45&quot;)&lt;/td&gt;
        &lt;td class=&quot;comment&quot;&gt;The rev is a singular value&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr class=&quot;assert&quot;&gt;
        &lt;td class=&quot;test&quot;&gt;vcard[0].role&lt;/td&gt;
        &lt;td class=&quot;result&quot;&gt;IsEqualTo(&quot;Designer&quot;)&lt;/td&gt;
        &lt;td class=&quot;comment&quot;&gt;The role is a singular value&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr class=&quot;assert&quot;&gt;
        &lt;td class=&quot;test&quot;&gt;vcard[0].sort-string&lt;/td&gt;
        &lt;td class=&quot;result&quot;&gt;IsEqualTo(&quot;John&quot;)&lt;/td&gt;
        &lt;td class=&quot;comment&quot;&gt;The sort-string is a singular value&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr class=&quot;assert&quot;&gt;
        &lt;td class=&quot;test&quot;&gt;vcard[0].tz&lt;/td&gt;
        &lt;td class=&quot;result&quot;&gt;IsEqualTo(&quot;-05:00&quot;)&lt;/td&gt;
        &lt;td class=&quot;comment&quot;&gt;The tz is a singular value&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr class=&quot;assert&quot;&gt;
        &lt;td class=&quot;test&quot;&gt;vcard[0].uid&lt;/td&gt;
        &lt;td class=&quot;result&quot;&gt;IsEqualTo(&quot;com.johndoe/profiles/johndoe&quot;)&lt;/td&gt;
        &lt;td class=&quot;comment&quot;&gt;The uid is a singular value&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt; 
    
    
&lt;p&gt;History:&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;history vevent&quot;&gt;
    &lt;span class=&quot;summary&quot;&gt;Created&lt;/span&gt;: 
    &lt;abbr class=&quot;dtstart&quot; title=&quot;2008-04-08&quot;&gt;8 April 2008&lt;/abbr&gt; 
    &lt;span class=&quot;description&quot;&gt;by Glenn Jones&lt;/span&gt;

&lt;/li&gt;
&lt;/ul&gt;
    
    
    
&lt;/div&gt;

</pre>

	<br />
	<br />
	<br />
	<br />
&nbsp;<a rel="license" href="license.txt">Some rights reserved</a>
    
    
</body>
</html>
